//go:build wireinject
// +build wireinject

package main

import (
	"github.com/go-redis/redis/v8"
	"github.com/google/wire"
	"github.com/labstack/echo/v4"
	"github.com/minio/minio-go/v7"
	"ruoyi-go-echo-ddd/internal/application"
	"ruoyi-go-echo-ddd/internal/domain/service"
	"ruoyi-go-echo-ddd/internal/infrastructure/http"
	"ruoyi-go-echo-ddd/internal/infrastructure/http/handler"
	"ruoyi-go-echo-ddd/internal/infrastructure/persistence/config"
	dao "ruoyi-go-echo-ddd/internal/infrastructure/persistence/dao/impl"
	"ruoyi-go-echo-ddd/internal/infrastructure/utils"
)

// WireApp 初始化应用
func WireApp(pgDb config.PrimaryDB, mysqlDb config.SecondaryDB, minioClient *minio.Client, redisClient *redis.Client, redisStore *utils.RedisStore) (*echo.Echo, func(), error) {
	panic(wire.Build(
		dao.ProviderSet,
		service.ProviderSet,
		application.ProviderSet,
		handler.ProviderSet,
		http.ProviderSet,
	))
}
